package com.scott.builder;

import lombok.ToString;

/**
 * @author Scott 2017/11/14 16:57
 */
@ToString
public class Person {

    private Long id;

    private String nickName;

    private int age;

    private String fullName;

    private String eMail;

    private String address;

    private String qq;

    private Person(Builder builder) {
        this.id = builder.id;

        this.nickName = builder.nickName;

        this.age = builder.age;

        this.fullName = builder.fullName;

        this.eMail = builder.eMail;

        this.address = builder.address;

        this.qq = builder.qq;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getFullName() {
        return fullName;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName;
    }

    public String geteMail() {
        return eMail;
    }

    public void seteMail(String eMail) {
        this.eMail = eMail;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getQq() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq = qq;
    }

    public static Builder builder() {
        return new Builder();
    }

    public static class Builder {
        private Long id;

        private String nickName;

        private int age;

        private String fullName;

        private String eMail;

        private String address;

        private String qq;

        public Builder id(Long id) {
            this.id = id;
            return this;
        }

        public Builder nickName(String nickName) {
            this.nickName = nickName;
            return this;
        }

        public Builder age(int age) {
            this.age = age;
            return this;
        }

        public Builder fullName(String fullName) {
            this.fullName = fullName;
            return this;
        }

        private Builder eMail(String eMail) {
            this.eMail = eMail;
            return this;
        }


        private Builder address(String address) {
            this.address = address;
            return this;
        }


        private Builder qq(String qq) {
            this.qq = qq;
            return this;
        }


        public Person build() {
            return new Person(this);
        }

    }

}
